﻿/// ---------------------------------------------
///
/// ---------------------------------------------

///---------------------------

//双击事件
function CustomDbClick() {
    //parent.closeWin(); //去掉双击功能
    fnViewDetail();
}


//添加信息
var fnCustomAdd = function () {
    const_EditEntity = "wkWorkBill";
    var pagetitle = "新增加班单据";
    parent._employeeTitle = pagetitle;
    parent.addTabs(pagetitle, encodeURI("../Extend/Edit.aspx?r=" + Math.random() + "&entity=" + const_EditEntity + "&fun=add&billtype=OVERTIME"));
    parent.NeedRefreshPage = this;

}

//修改信息
var fnCustomEdit = function () {
    var recordID = myDataTable.getSelectedRows()[0];
    record = myDataTable.getRecord(recordID);
    if (record == null) {
        alert("请选择一条记录");
        return;
    }
    const_EditEntity = "wkWorkBill";
    var pagetitle = "修改加班单据";
    parent._employeeTitle = pagetitle;
    parent.addTabs(pagetitle, encodeURI("../Extend/Edit.aspx?r=" + Math.random() + "&entity=" + const_EditEntity + "&fun=edit&billtype=OVERTIME" + "&id=" + record.getData(const_entityID)));
    parent.NeedRefreshPage = this;

}

//查看
var fnViewDetail = function () {
    var recordID = myDataTable.getSelectedRows()[0];
    record = myDataTable.getRecord(recordID);
    if (record == null) {
        alert("请选择一条记录");
        return;
    }
    const_EditEntity = "wkWorkBill";
    //debugger;
    var pagetitle = "查看加班单据";
    parent._employeeTitle = pagetitle;
    parent.addTabs(pagetitle, encodeURI("../Extend/Edit.aspx?r=" + Math.random() + "&entity=" + const_EditEntity + "&fun=view&billtype=OVERTIME" + "&id=" + record.getData(const_entityID)));
    parent.NeedRefreshPage = this;
}

//初始化
if (typeof ($) != "undefined") {
    $(document).ready(function () {

    });
}


